/ Assembly List / LJCNetCommon / TextBuilder / Item

Namespace - LJCNetCommon


Parameters
text - The next append value.
addIndent - Indicates if the element can be indented.
allowNewLine - Indicates if a new line can be added.

Returns

The potentially indented, delimited and wrapped new text value.

Syntax

C#
public String Item(String text, Boolean addIndent = True, Boolean allowNewLine = True)

Adds a delimiter if not the first list item and adds a newline if line length is greater than CharLength.

Example

C#
// Defaults: IndentCharCount = 2, LineLimit = 80, WrapEnabled = false.
var tb = new TextBuilder();

// Defaults: IsFirst = true, Delimiter = ", ".
for int index = 0; index < 14; index++)
      {
// Example Method
var text = $"{index}**-";
tb.Item(text, NoIndent, NoNewLine);
      }
r saveResult = tb.ToString();

  result:
  0**-, 1**-, 2**-, 3**-, 4**-, 5**-, 6**-, 7**-, 8**-, 9**-, 10**-, 11**-, 12**-, 13**-, 14**-

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.